﻿//vector服务
function VectorService(layerInfo) {
    var VectorService = new Object;
    VectorService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    VectorService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL : "";
    VectorService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    VectorService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    VectorService.CreateLayer = function () {
        var id = this.id;
        var url = this.url;
        var name = this.name;
        var servertype = this.servertype;
        var thisLayer = new ol.layer.Vector({
            source: new ol.source.Vector({
                url: url,
                format: new ol.format.GeoJSON(),
                id: id,
                wrapX: false
            })

        });
        return thisLayer;
    }
    return VectorService;
}